package br.com.insight.consultoria.negocio.bo;

import java.util.List;

import br.com.insight.consultoria.entity.InformacoesAcademicas;
import br.com.insight.consultoria.entity.Usuario;
import br.com.insight.consultoria.erro.exception.InsightConstants;
import br.com.insight.consultoria.erro.exception.InsightException;
import br.com.insight.consultoria.erro.exception.SistemaException;
import br.com.insight.consultoria.integracao.dao.interfacedao.InformacoesAcademicasDAO;
import br.com.insight.consultoria.negocio.bo.interfacebo.InformacoesAcademicasBO;

public class InformacoesAcademicasImpBO implements InformacoesAcademicasBO{

	
	private InformacoesAcademicasDAO informacoesAcademicasDAO;
	
	
	public void inserir(InformacoesAcademicas informacoesAcademicas) throws InsightException {
		
		try{
		
			getInformacoesAcademicasDAO().inserir(informacoesAcademicas);
			
		}catch(InsightException exception){
			
			throw exception;
			
		}catch(Exception exception){
			
			throw new SistemaException(InsightConstants.MENSAGEM_ERRO_NAO_TRATADO,exception);
			
		}
	}
	
	public void alterar(InformacoesAcademicas informacoesAcademicas) throws InsightException {
	
		try{
		
		getInformacoesAcademicasDAO().alterar(informacoesAcademicas);
		
	}catch(InsightException exception){
		
		throw exception;
		
	}catch(Exception exception){
		
		throw new SistemaException(InsightConstants.MENSAGEM_ERRO_NAO_TRATADO,exception);
		
	}
		
	}
	
	public void excluir(InformacoesAcademicas informacoesAcademicas) throws InsightException {

		try{
		
			getInformacoesAcademicasDAO().excluir(informacoesAcademicas);
		
		}catch(InsightException exception){
			
			throw exception;
			
		}catch(Exception exception){
			
			throw new SistemaException(InsightConstants.MENSAGEM_ERRO_NAO_TRATADO,exception);
			
		}
			
	}
	
	public InformacoesAcademicas getInformacoesAcademicas(Long id) throws InsightException {
		
		InformacoesAcademicas academicas=null;
		
		try{
		
			academicas=getInformacoesAcademicasDAO().getInformacoesAcademicas(id);
			
		}catch(InsightException exception){
			
			throw exception;
			
		}catch(Exception exception){
			
			throw new SistemaException(InsightConstants.MENSAGEM_ERRO_NAO_TRATADO,exception);
			
		}
			
		return academicas;
	}
	
	public List<InformacoesAcademicas> pesquisar(Usuario usuario) throws InsightException {
		
		List<InformacoesAcademicas> academicas=null;
		
		try{
		
			academicas=getInformacoesAcademicasDAO().pesquisar(usuario);
			
		}catch(InsightException exception){
			
			throw exception;
			
		}catch(Exception exception){
			
			throw new SistemaException(InsightConstants.MENSAGEM_ERRO_NAO_TRATADO,exception);
			
		}
			
		return academicas;
	}

	
	public InformacoesAcademicasDAO getInformacoesAcademicasDAO() {
		return informacoesAcademicasDAO;
	}

	public void setInformacoesAcademicasDAO(
			InformacoesAcademicasDAO informacoesAcademicasDAO) {
		this.informacoesAcademicasDAO = informacoesAcademicasDAO;
	}
	
	
	
}
